<?php
	require_once('Zend/Currency.php');
    $currency = new Zend_Currency('cs_CZ');
 ?>

<h2><?= $this->translate("OrderDetail") ?></h2>

<dl>
    <dt><?= $this->translate("Id") ?>:</dt>
        <dd><?= $this->order->id; ?></dd>
    <dt><?= $this->translate("User") ?>:</dt>
        <dd><a href="<?= $this->url(array("controller"=>"users","action"=>"user-detail","id"=>$this->order->User->id)) ?>" title="<?= $this->order->User->username ?>"><?= $this->order->User->username ?></a></dd>
    <dt><?= $this->translate("TotalPrice") ?>:</dt>
        <dd><?= $currency->toCurrency($this->order_totalPrice) ?></dd>
    <dt><?= $this->translate("Time") ?>:</dt>
        <?php
            $dateCreated = explode('-',substr($this->order->timecreated,0,10));
            $timeCreated = substr($this->order->timecreated,11,5);
        ?>
        <dd><?= $dateCreated[2] . '.' . $dateCreated[1] . '. ' . $dateCreated[0] . ' ' . $timeCreated ?></dd>
</dl>
<table>
  <caption><strong><?= $this->translate("Items") ?>:</strong></caption>
  <tr>
    <th><?= $this->translate('Description') ?></th>
    <th><?= $this->translate('Price') ?></th>
    <th><?= $this->translate('Amount') ?></th>
    <th><?= $this->translate('TotalPrice') ?></th>
  </tr>
  <?php foreach( $this->order->Items as $item ) { ?>
	  <tr>
	    <td><?= $item->translate("description") ?></td>
	    <td><?= $currency->toCurrency($item->price) ?></td>
	    <td><?= $item->amount; ?></td>
	    <td><?= $currency->toCurrency($item->price * $item->amount) ?></td>
	  </tr>
  <?php } ?>
</table>


<?= $this->form; ?>